import 'package:flutter/material.dart';
import 'package:flutter_swiper/flutter_swiper.dart';

class MainPage extends StatefulWidget {
  MainPage({Key key}) : super(key: key);

  @override
  _MainPageState createState() => _MainPageState();
}

class _MainPageState extends State<MainPage> {
  final List<String> images = [
    'assets/home/swiper1.jpg',
    'assets/home/swiper2.jpg',
    'assets/home/swiper3.jpg'
  ];
  @override
  Widget build(BuildContext context) {
    return ListView(
      children: [
        Container(
          height: 200,
          child: Swiper(
            itemBuilder: (BuildContext context, int index) {
              return Image.asset(
                images[index],
                fit: BoxFit.fill,
              );
            },
            itemCount: images.length,
            autoplay: true,
            // 滚动方向
            scrollDirection: Axis.horizontal,
            // 小圆点
            pagination: SwiperPagination(alignment: Alignment.bottomCenter),
            // 左右箭头
            // control: SwiperControl(),
          ),
        ),
        Container(
          child: Column(
            children: [
              Container(
                child: Column(
                  children: [
                    Row(
                      children: [
                        Text("青年汇店"),
                        Expanded(child: Container()),
                        Text('dkfj')
                      ],
                    ),
                    Row(
                      children: [
                        Text("距您56米"),
                        Expanded(child: Container()),
                        Text('dkfj')
                      ],
                    ),
                  ],
                ),
              ),
            ],
          ),
        ),
        Image.asset(
          'assets/home/bottom_bar.png',
          fit: BoxFit.fitHeight,
          height: 100.0,
        ),
      ],
    );
  }
}
